package qhdx.fiveGC.config;

/**
 * @Author:陈旷
 * @DATE : 2022/1/26
 * @description:
 */
public class DataSourceContextHolder {

    public static final String DEFAULT_DS = "db1";

    private static final ThreadLocal<String> contextHolder = new ThreadLocal<>();

    //设置数据源名
    public static void setDB(String dbType){
        contextHolder.set(dbType);
    }

    public static String getDB(){
        return (contextHolder.get());
    }

    public static void clearDB(){
        contextHolder.remove();
    }

}
